package com.alibaba.citrus.ots.sales.plan.functions.salesplan;

import com.alibaba.citrus.ots.common.util.SpringContextUtil;
import com.alibaba.citrus.ots.sales.plan.repository.SalesPlanScItemExtendRepository;
import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanDetailSDO;
import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanPublishSDO;
import lombok.Getter;
import lombok.Setter;

public class SalesPlanDetailEntity {

    @Getter
    @Setter
    private SalesPlanDetailSDO salesPlanDetailSDO;

    private static SalesPlanScItemExtendRepository salesPlanScItemExtendRepository;

    static {
        salesPlanScItemExtendRepository = SpringContextUtil.getBean(SalesPlanScItemExtendRepository.class);
    }

    public static SalesPlanDetailEntity of(SalesPlanDetailSDO salesPlanDetailSDO) {
        SalesPlanDetailEntity entity = new SalesPlanDetailEntity();
        entity.setSalesPlanDetailSDO(salesPlanDetailSDO);
        return entity;
    }

    public Integer doEdit() {
        return salesPlanScItemExtendRepository.editSalesPlanDetail(salesPlanDetailSDO);
    }
}
